package me.chan.completableFuture;

import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Locale;
import java.util.Random;

public class Util {

	private static final Random RANDOM = new Random(0);
	private static final DecimalFormat formatter = new DecimalFormat("#.##", new DecimalFormatSymbols(Locale.CHINA));
	
	public static void delay() {
		int delay = 1000;
		try {
			Thread.sleep(delay);
		} catch (InterruptedException ex) {
			throw new RuntimeException(ex);
		}
	}
	
	public static double format(double number) {
        synchronized (formatter) {
            return new Double(formatter.format(number));
        }
}
}
